<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('attraction_user_booking', function (Blueprint $table) {
            $table->comment('预约订单表');
            $table->bigIncrements('id')->nullable(false)->comment('预约订单编号');
            $table->integer('user_id')->nullable(false)->comment('用户id');
            $table->integer('info_id')->nullable(false)->comment('预约活动信息id');
            $table->dateTime('booking_day')->nullable(false)->comment('预约日期');
            $table->string('booking_time', 32)->nullable(false)->comment('预约时间段');
            $table->integer('status')->nullable(false)->comment('预约状态1已预约2已取消3已使用');
            $table->datetimes();
            $table->softDeletes();
        });

        // 设置自增起始值为100000
        \Hyperf\DbConnection\Db::statement('ALTER TABLE attraction_user_booking AUTO_INCREMENT = 100000;');
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('attraction_user_booking');
    }
};
